package cn.edu.njust.epms.service;

import cn.edu.njust.epms.common.R;
import cn.edu.njust.epms.entity.ModApply;
import cn.edu.njust.epms.entity.User;
import cn.edu.njust.epms.common.Resp;
import cn.edu.njust.epms.entity.UserDetails;
import org.springframework.transaction.annotation.Transactional;

import java.util.ArrayList;
import java.util.List;

@Transactional
public interface UserService {
    public Resp<User> Login(User user);
    public Resp<ArrayList<User>> selectAll();

    public Resp<User> Register(User user);

    public Resp<User> auditInfo(User user);

    Resp<String> updatePwd(User user);

//    Result<String> updateInfo(User user);

//    Result<String> applyMod(UserDetails ud);

    Resp<String> updateInfo(UserDetails ud);

    Resp<String> applyMod(ModApply ma);

//    Resp<List<User>> selectByCondition(R r);

//    Result<String> modApply(ModApply ma);

    @Transactional(rollbackFor = Exception.class)
    Resp<String> audApply(ModApply ma);

//    Result<List<ModApply>> selectByCondition(Record r);

    Resp<List<ModApply>> selectAppByCondition(R r);

//    Result<String> addDetails(UserDetails ud);

    Resp<String> addDetails(ModApply ma);

    Resp<List<UserDetails>> selectUserByCondition(R r);

    Resp<String> deleteUser(User user);

    Resp<String> deleteuDetail(UserDetails ud);

   List<UserDetails> selectUdByuId(Integer uId);

    UserDetails selectUdByPid(String pid);
}
